package com.ccrfid.rmc6.entity.business.prison.rollcall;

import javax.persistence.*;
import java.sql.Time;
import java.sql.Timestamp;

@Entity
@Table(name = "prison_rollcall_result")
public class PrisonRollcallResultEntity {
    private Long id;
    private Time taskTime;
    private Timestamp rollcallTime;
    private Long policeId;
    private String policeSn;
    private String policeName;
    private Long placeId;
    private String placeName;
    private Integer totalCount;
    private Integer attendanceCount;
    private Double attendanceRate;

    @Id
    @Column(name = "id", nullable = false)
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Basic
    @Column(name = "task_time", nullable = false)
//    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "HH:mm")
    public Time getTaskTime() {
        return taskTime;
    }

    public void setTaskTime(Time taskTime) {
        this.taskTime = taskTime;
    }

    @Basic
    @Column(name = "rollcall_time", nullable = false)
    public Timestamp getRollcallTime() {
        return rollcallTime;
    }

    public void setRollcallTime(Timestamp rollcallTime) {
        this.rollcallTime = rollcallTime;
    }

    @Basic
    @Column(name = "police_id", nullable = false)
    public Long getPoliceId() {
        return policeId;
    }

    public void setPoliceId(Long policeId) {
        this.policeId = policeId;
    }

    @Basic
    @Column(name = "police_sn", length = 45, nullable = true)
    public String getPoliceSn() {
        return policeSn;
    }

    public void setPoliceSn(String policeSn) {
        this.policeSn = policeSn;
    }

    @Basic
    @Column(name = "police_name", length = 32, nullable = false)
    public String getPoliceName() {
        return policeName;
    }

    public void setPoliceName(String policeName) {
        this.policeName = policeName;
    }

    @Basic
    @Column(name = "place_id", nullable = false)
    public Long getPlaceId() {
        return placeId;
    }

    public void setPlaceId(Long placeId) {
        this.placeId = placeId;
    }

    @Basic
    @Column(name = "place_name", length = 45, nullable = false)
    public String getPlaceName() {
        return placeName;
    }

    public void setPlaceName(String placeName) {
        this.placeName = placeName;
    }

    @Basic
    @Column(name = "total_count", nullable = false)
    public Integer getTotalCount() {
        return totalCount;
    }

    public void setTotalCount(Integer totalCount) {
        this.totalCount = totalCount;
    }

    @Basic
    @Column(name = "attendance_count", nullable = false)
    public Integer getAttendanceCount() {
        return attendanceCount;
    }

    public void setAttendanceCount(Integer attendanceCount) {
        this.attendanceCount = attendanceCount;
    }

    @Basic
    @Column(name = "attendance_rate", nullable = false)
    public Double getAttendanceRate() {
        return attendanceRate;
    }

    public void setAttendanceRate(Double attendanceRate) {
        this.attendanceRate = attendanceRate;
    }

    @Override
    public String toString() {
        return "PrisonRollcallResultEntity{" +
                "id=" + id +
                ", taskTime=" + taskTime +
                ", rollcallTime=" + rollcallTime +
                ", policeId=" + policeId +
                ", policeSn='" + policeSn + '\'' +
                ", policeName='" + policeName + '\'' +
                ", placeId=" + placeId +
                ", placeName='" + placeName + '\'' +
                ", totalCount=" + totalCount +
                ", attendanceCount=" + attendanceCount +
                ", attendanceRate=" + attendanceRate +
                '}';
    }
}
